﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>LoginMvc: LoginMvc.h Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                LoginMvc: LoginMvc.h Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">LoginMvc.h</div>  </div>
</div>
<div class="contents">
<a href="_login_mvc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef LOGINMVC_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define LOGINMVC_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;QtCore/QObject&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;QtCore/QTimer&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;QtGui/QMainWindow&gt;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;QtGui/QApplication&gt;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;QtGui/QLabel&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;QtGui/QMessageBox&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;ui_frame.h&quot;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;QtNetwork/QNetworkAccessManager&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;QtNetwork/QNetworkReply&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;QtNetwork/QSslSocket&gt;</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;QsLog.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;LoginMvcFsm.h&quot;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="class_abstract_model.html">00020</a> <span class="keyword">class </span><a class="code" href="class_abstract_model.html">AbstractModel</a> : <span class="keyword">public</span> QObject
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022     Q_OBJECT
<a name="l00023"></a>00023 <span class="keyword">public</span>:
<a name="l00024"></a><a class="code" href="class_abstract_model.html#a72f2d91eb7b8319df76ab929b74a69d8">00024</a>     <a class="code" href="class_abstract_model.html#a72f2d91eb7b8319df76ab929b74a69d8">AbstractModel</a>(QObject* o = NULL) : QObject(o)
<a name="l00025"></a>00025     {
<a name="l00026"></a>00026     }
<a name="l00027"></a>00027 <span class="keyword">public</span> slots:
<a name="l00028"></a>00028     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_abstract_model.html#aae115f9abc845a2ea0374caaf7be1acf">login</a>(<span class="keyword">const</span> QString &amp; u, <span class="keyword">const</span> QString &amp; p) = 0;
<a name="l00029"></a>00029 signals:
<a name="l00030"></a>00030     <span class="keywordtype">void</span> <a class="code" href="class_abstract_model.html#ab73cc114bd8df92f252deaf1826d6ac6">loginComplete</a>(<span class="keywordtype">bool</span>);
<a name="l00031"></a>00031 };
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 
<a name="l00034"></a><a class="code" href="class_dummy_model.html">00034</a> <span class="keyword">class </span><a class="code" href="class_dummy_model.html">DummyModel</a> : <span class="keyword">public</span> <a class="code" href="class_abstract_model.html">AbstractModel</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036     Q_OBJECT
<a name="l00037"></a>00037 <span class="keyword">public</span>:
<a name="l00038"></a><a class="code" href="class_dummy_model.html#a1a3eb1f70a222b997f60bdf059f79a88">00038</a>     <a class="code" href="class_dummy_model.html#a1a3eb1f70a222b997f60bdf059f79a88">DummyModel</a>(QObject* o = NULL) : <a class="code" href="class_abstract_model.html">AbstractModel</a>(o)
<a name="l00039"></a>00039     {
<a name="l00040"></a>00040     }
<a name="l00041"></a>00041 <span class="keyword">public</span> slots:
<a name="l00042"></a><a class="code" href="class_dummy_model.html#afc6eeee35e7592aedb4432fec2ad2ed1">00042</a>     <span class="keywordtype">void</span> <a class="code" href="class_dummy_model.html#afc6eeee35e7592aedb4432fec2ad2ed1">test</a>()
<a name="l00043"></a>00043     {
<a name="l00044"></a>00044         QLOG_INFO();
<a name="l00045"></a>00045         emit <a class="code" href="class_dummy_model.html#ad1fdb4ec1cf7e90e29cc8ab4a2938015">loginComplete</a>(<a class="code" href="class_dummy_model.html#a2db920e5feaad3b725cfaf1b39b798cd">user</a> == <span class="stringliteral">&quot;user&quot;</span> &amp;&amp; <a class="code" href="class_dummy_model.html#a95fdb0214b24d366526a68967e3e74f8">password</a> == <span class="stringliteral">&quot;password&quot;</span>);
<a name="l00046"></a>00046     }
<a name="l00047"></a><a class="code" href="class_dummy_model.html#a1b682235a6e23980b613f2b02b79c684">00047</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_dummy_model.html#a1b682235a6e23980b613f2b02b79c684">login</a>(<span class="keyword">const</span> QString &amp; u, <span class="keyword">const</span> QString &amp; p)
<a name="l00048"></a>00048     {
<a name="l00049"></a>00049         QLOG_INFO() &lt;&lt; <span class="stringliteral">&quot;username &quot;</span> &lt;&lt; u;
<a name="l00050"></a>00050         <a class="code" href="class_dummy_model.html#a2db920e5feaad3b725cfaf1b39b798cd">user</a> = u; <a class="code" href="class_dummy_model.html#a95fdb0214b24d366526a68967e3e74f8">password</a> = p;
<a name="l00051"></a>00051         QTimer::singleShot(5000,<span class="keyword">this</span>,SLOT(<a class="code" href="class_dummy_model.html#afc6eeee35e7592aedb4432fec2ad2ed1">test</a>()));
<a name="l00052"></a>00052     }
<a name="l00053"></a>00053 signals:
<a name="l00054"></a>00054     <span class="keywordtype">void</span> <a class="code" href="class_dummy_model.html#ad1fdb4ec1cf7e90e29cc8ab4a2938015">loginComplete</a>(<span class="keywordtype">bool</span>);
<a name="l00055"></a>00055 <span class="keyword">private</span>:
<a name="l00056"></a><a class="code" href="class_dummy_model.html#a2db920e5feaad3b725cfaf1b39b798cd">00056</a>     QString <a class="code" href="class_dummy_model.html#a2db920e5feaad3b725cfaf1b39b798cd">user</a>,<a class="code" href="class_dummy_model.html#a95fdb0214b24d366526a68967e3e74f8">password</a>;
<a name="l00057"></a><a class="code" href="class_dummy_model.html#ae126562c6a3bccfca2159c92afdda305">00057</a>     QNetworkAccessManager <a class="code" href="class_dummy_model.html#ae126562c6a3bccfca2159c92afdda305">netAccess</a>;
<a name="l00058"></a>00058 };
<a name="l00059"></a><a class="code" href="class_g_mail_model.html">00059</a> <span class="keyword">class </span><a class="code" href="class_g_mail_model.html">GMailModel</a> : <span class="keyword">public</span> <a class="code" href="class_abstract_model.html">AbstractModel</a>
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061     Q_OBJECT
<a name="l00062"></a>00062 <span class="keyword">public</span>:
<a name="l00063"></a><a class="code" href="class_g_mail_model.html#a1f2fa46912f1a0e5c4aa91c895826591">00063</a>     <a class="code" href="class_g_mail_model.html#a1f2fa46912f1a0e5c4aa91c895826591">GMailModel</a>(QObject* o = NULL) : <a class="code" href="class_abstract_model.html">AbstractModel</a>(o)
<a name="l00064"></a>00064     {
<a name="l00065"></a>00065     }
<a name="l00066"></a>00066 <span class="keyword">public</span> slots:
<a name="l00067"></a><a class="code" href="class_g_mail_model.html#a171b04c63668f4bd26b7962e63f87c2e">00067</a>     <span class="keywordtype">void</span> <a class="code" href="class_g_mail_model.html#a171b04c63668f4bd26b7962e63f87c2e">loginFinished</a>()
<a name="l00068"></a>00068     {
<a name="l00069"></a>00069         QNetworkReply* rep = qobject_cast&lt;QNetworkReply*&gt;(sender());
<a name="l00070"></a>00070         rep-&gt;deleteLater();
<a name="l00071"></a>00071         QLOG_INFO() &lt;&lt; rep-&gt;error() &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; rep-&gt;errorString();
<a name="l00072"></a>00072         emit <a class="code" href="class_abstract_model.html#ab73cc114bd8df92f252deaf1826d6ac6">loginComplete</a>(rep-&gt;error() == QNetworkReply::NoError);
<a name="l00073"></a>00073     }
<a name="l00074"></a><a class="code" href="class_g_mail_model.html#ab27beb66c086da015630dbac51182c9f">00074</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_g_mail_model.html#ab27beb66c086da015630dbac51182c9f">login</a>(<span class="keyword">const</span> QString &amp; u, <span class="keyword">const</span> QString &amp; p)
<a name="l00075"></a>00075     {
<a name="l00076"></a>00076         QNetworkRequest req;
<a name="l00077"></a>00077         QUrl url(<span class="stringliteral">&quot;https://mail.google.com/mail/feed/atom&quot;</span>);
<a name="l00078"></a>00078         url.setUserName(u);
<a name="l00079"></a>00079         url.setPassword(p);
<a name="l00080"></a>00080         req.setUrl(url);
<a name="l00081"></a>00081         QNetworkReply* reply = <a class="code" href="class_g_mail_model.html#aa83a5820e73950d870461cba9d60aa2a">netAccess</a>.get(req);
<a name="l00082"></a>00082         reply-&gt;ignoreSslErrors();
<a name="l00083"></a>00083         connect(reply,SIGNAL(finished()),<span class="keyword">this</span>,SLOT(<a class="code" href="class_g_mail_model.html#a171b04c63668f4bd26b7962e63f87c2e">loginFinished</a>()));
<a name="l00084"></a>00084     }
<a name="l00085"></a>00085 <span class="keyword">private</span>:
<a name="l00086"></a><a class="code" href="class_g_mail_model.html#aa83a5820e73950d870461cba9d60aa2a">00086</a>     QNetworkAccessManager <a class="code" href="class_g_mail_model.html#aa83a5820e73950d870461cba9d60aa2a">netAccess</a>;
<a name="l00087"></a>00087 };
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 
<a name="l00090"></a><a class="code" href="class_my_view.html">00090</a> <span class="keyword">class </span><a class="code" href="class_my_view.html">MyView</a> : <span class="keyword">public</span> QFrame, <span class="keyword">public</span> <span class="keyword">virtual</span> Ui::Frame
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092     Q_OBJECT
<a name="l00093"></a>00093 <span class="keyword">public</span>:
<a name="l00094"></a><a class="code" href="class_my_view.html#a35eb74bc962dbe7678e8f6407c81c039">00094</a>     QString <a class="code" href="class_my_view.html#a35eb74bc962dbe7678e8f6407c81c039">welcomeText</a>;
<a name="l00095"></a><a class="code" href="class_my_view.html#abe0a723b28a3587993efcb70960acf21">00095</a>     <a class="code" href="class_my_view.html#abe0a723b28a3587993efcb70960acf21">MyView</a>(QWidget* o = NULL) : QFrame(o)
<a name="l00096"></a>00096     {
<a name="l00097"></a>00097         setupUi(<span class="keyword">this</span>);
<a name="l00098"></a>00098         connect(loginButton,SIGNAL(clicked()),<span class="keyword">this</span>,SIGNAL(<a class="code" href="class_my_view.html#a135de69fbe242fb530997c9d8e0993c6">loginIntent</a>()));
<a name="l00099"></a>00099         connect(logoutButton,SIGNAL(clicked()),<span class="keyword">this</span>,SIGNAL(<a class="code" href="class_my_view.html#a289cd45f6704274dd9686db724881159">logoutIntent</a>()));
<a name="l00100"></a>00100         connect(cancelButton,SIGNAL(clicked()),<span class="keyword">this</span>,SIGNAL(<a class="code" href="class_my_view.html#a70eb3878d4d80b62e703852a40026c20">cancelIntent</a>()));
<a name="l00101"></a>00101     }
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 <span class="keyword">public</span> slots:
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="class_my_view.html#a0c1ad0e7d8aee46a472509772b9ac561">00105</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a0c1ad0e7d8aee46a472509772b9ac561">notifyLogin</a>()
<a name="l00106"></a>00106     {
<a name="l00107"></a>00107         QLOG_INFO();
<a name="l00108"></a>00108         QMessageBox::information(<span class="keyword">this</span>,<span class="stringliteral">&quot;Logged In&quot;</span>,<span class="stringliteral">&quot;You are now logged in!&quot;</span>);
<a name="l00109"></a>00109         emit <a class="code" href="class_my_view.html#a8fc2570e040a4c4d7488e61147cd3321">contIntent</a>();
<a name="l00110"></a>00110     }
<a name="l00111"></a><a class="code" href="class_my_view.html#a6988b0a9700e68a9af1e61f516215341">00111</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a6988b0a9700e68a9af1e61f516215341">notifyTimeout</a>()
<a name="l00112"></a>00112     {
<a name="l00113"></a>00113         QLOG_INFO();
<a name="l00114"></a>00114         QMessageBox::information(<span class="keyword">this</span>,<span class="stringliteral">&quot;Timeout...&quot;</span>,<span class="stringliteral">&quot;Sorry, login has timed out&quot;</span>);
<a name="l00115"></a>00115         emit <a class="code" href="class_my_view.html#a8fc2570e040a4c4d7488e61147cd3321">contIntent</a>();
<a name="l00116"></a>00116     }
<a name="l00117"></a><a class="code" href="class_my_view.html#a7c454836b0745929963cfa24a71b9022">00117</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a7c454836b0745929963cfa24a71b9022">notifyWelcome</a>()
<a name="l00118"></a>00118     {
<a name="l00119"></a>00119         QLOG_INFO();
<a name="l00120"></a>00120         QMessageBox::information(<span class="keyword">this</span>,<span class="stringliteral">&quot;Welcome!&quot;</span>,<a class="code" href="class_my_view.html#a35eb74bc962dbe7678e8f6407c81c039">welcomeText</a>);
<a name="l00121"></a>00121     }
<a name="l00122"></a><a class="code" href="class_my_view.html#a7d548adc19f00400dd46c31bb7ea04cc">00122</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a7d548adc19f00400dd46c31bb7ea04cc">notifyError</a>()
<a name="l00123"></a>00123     {
<a name="l00124"></a>00124         QLOG_INFO();
<a name="l00125"></a>00125         QMessageBox::warning(<span class="keyword">this</span>,<span class="stringliteral">&quot;Not Logged in&quot;</span>,<span class="stringliteral">&quot;Login has failed...&quot;</span>);
<a name="l00126"></a>00126         emit <a class="code" href="class_my_view.html#a8fc2570e040a4c4d7488e61147cd3321">contIntent</a>();
<a name="l00127"></a>00127         QLOG_INFO() &lt;&lt; <span class="stringliteral">&quot;done&quot;</span>;
<a name="l00128"></a>00128     }
<a name="l00129"></a>00129 
<a name="l00130"></a><a class="code" href="class_my_view.html#ac797918e0f921e9fa6adaa98dd8877e9">00130</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#ac797918e0f921e9fa6adaa98dd8877e9">notifyCancel</a>()
<a name="l00131"></a>00131     {
<a name="l00132"></a>00132         QLOG_INFO();
<a name="l00133"></a>00133         QMessageBox::information(<span class="keyword">this</span>,<span class="stringliteral">&quot;Cancel&quot;</span>,<span class="stringliteral">&quot;You have cancelled&quot;</span>);
<a name="l00134"></a>00134         emit <a class="code" href="class_my_view.html#a8fc2570e040a4c4d7488e61147cd3321">contIntent</a>();
<a name="l00135"></a>00135     }
<a name="l00136"></a><a class="code" href="class_my_view.html#a1e10251d3af7858190a284106194e7c5">00136</a>     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a1e10251d3af7858190a284106194e7c5">notifyHello</a>(<span class="keyword">const</span> QString &amp; name)
<a name="l00137"></a>00137     {
<a name="l00138"></a>00138         QLOG_INFO() &lt;&lt; name;
<a name="l00139"></a>00139         QMessageBox::information(<span class="keyword">this</span>,<span class="stringliteral">&quot;Welcome&quot;</span>,QString(<span class="stringliteral">&quot;Hello &quot;</span>) + name);
<a name="l00140"></a>00140     }
<a name="l00141"></a>00141 
<a name="l00142"></a>00142 signals:
<a name="l00143"></a>00143     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a135de69fbe242fb530997c9d8e0993c6">loginIntent</a>();
<a name="l00144"></a>00144     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a289cd45f6704274dd9686db724881159">logoutIntent</a>();
<a name="l00145"></a>00145     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a70eb3878d4d80b62e703852a40026c20">cancelIntent</a>();
<a name="l00146"></a>00146     <span class="keywordtype">void</span> <a class="code" href="class_my_view.html#a8fc2570e040a4c4d7488e61147cd3321">contIntent</a>();
<a name="l00147"></a>00147 };
<a name="l00148"></a>00148 
<a name="l00149"></a><a class="code" href="class_login_mvc.html">00149</a> <span class="keyword">class </span><a class="code" href="class_login_mvc.html">LoginMvc</a> : <span class="keyword">public</span> QMainWindow
<a name="l00150"></a>00150 {
<a name="l00151"></a>00151     Q_OBJECT
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="keyword">public</span>:
<a name="l00154"></a>00154     <a class="code" href="class_login_mvc.html#a1f45b4aa714832050bbd34295c409891">LoginMvc</a>(<span class="keywordtype">bool</span> use_gmail);
<a name="l00155"></a>00155     <a class="code" href="class_login_mvc.html#a245823ee215c6d32ee3fe2a56c9da233">~LoginMvc</a>();
<a name="l00156"></a>00156     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a87ab429303da93e11764b00db15847d5">start</a>();
<a name="l00157"></a>00157 
<a name="l00158"></a><a class="code" href="class_login_mvc.html#a3665a1dd1b9954ff80815ad7ad611538">00158</a>     <a class="code" href="class_my_view.html">MyView</a>* <a class="code" href="class_login_mvc.html#a3665a1dd1b9954ff80815ad7ad611538">getView</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_login_mvc.html#a822a8c9fc27e024f9a4f506a997c0b9a">m_pView</a>;};
<a name="l00159"></a><a class="code" href="class_login_mvc.html#a5d5c82279a85071afa6554deab4832c2">00159</a>     <a class="code" href="class_abstract_model.html">AbstractModel</a>* <a class="code" href="class_login_mvc.html#a5d5c82279a85071afa6554deab4832c2">getModel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_login_mvc.html#a95a90c5c202ead622c77035868507d0f">m_pModel</a>;};
<a name="l00160"></a>00160 
<a name="l00161"></a><a class="code" href="class_login_mvc.html#a4bf43f44a59052b0d6f08fc06a3b51d0">00161</a>     <span class="keyword">const</span> QString&amp; <a class="code" href="class_login_mvc.html#a4bf43f44a59052b0d6f08fc06a3b51d0">getUsername</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_login_mvc.html#ab3b8d0e25bea9f29874af6d0571951d7">m_username</a>;};
<a name="l00162"></a><a class="code" href="class_login_mvc.html#a8a783a0322a443a4a1404cbb9c4a58e6">00162</a>     <span class="keyword">const</span> QString&amp; <a class="code" href="class_login_mvc.html#a8a783a0322a443a4a1404cbb9c4a58e6">getPassword</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_login_mvc.html#ae51d46d55a387571ac137c6187a36831">m_password</a>;};
<a name="l00163"></a><a class="code" href="class_login_mvc.html#ae76d961754cb270010d06e60b6c3d523">00163</a>     <span class="keywordtype">int</span> <a class="code" href="class_login_mvc.html#ae76d961754cb270010d06e60b6c3d523">getLoginTimeout</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_login_mvc.html#a7a1ca2ff001c8500a230f69cddf12ae6">m_loginTimeout</a>;};
<a name="l00164"></a>00164 
<a name="l00165"></a>00165     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a2963191e772303b37528fa27ba52394c">login</a>();
<a name="l00166"></a>00166 
<a name="l00167"></a>00167 <span class="keyword">private</span> slots:
<a name="l00168"></a>00168 
<a name="l00169"></a><a class="code" href="class_login_mvc.html#a6bac2139d918bfecfabd7d80614404ba">00169</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a6bac2139d918bfecfabd7d80614404ba">setUsername</a>(<span class="keyword">const</span> QString&amp; username) {<a class="code" href="class_login_mvc.html#ab3b8d0e25bea9f29874af6d0571951d7">m_username</a> =  username;}
<a name="l00170"></a><a class="code" href="class_login_mvc.html#acb85bf0dda3fbd7ce20e8bc9e9171228">00170</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#acb85bf0dda3fbd7ce20e8bc9e9171228">setPassword</a>(<span class="keyword">const</span> QString&amp; password) {<a class="code" href="class_login_mvc.html#ae51d46d55a387571ac137c6187a36831">m_password</a> =  password;}
<a name="l00171"></a><a class="code" href="class_login_mvc.html#a08ce56f8c34448f63347e627fee1cbb8">00171</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a08ce56f8c34448f63347e627fee1cbb8">setLoginTimeout</a>(<span class="keywordtype">int</span> loginTimeout) { <a class="code" href="class_login_mvc.html#a7a1ca2ff001c8500a230f69cddf12ae6">m_loginTimeout</a> = loginTimeout;}
<a name="l00172"></a>00172 
<a name="l00173"></a>00173     <span class="comment">// Events from the View to the Fsm</span>
<a name="l00174"></a><a class="code" href="class_login_mvc.html#a5bcddfb319a59f74ddb86f819ac3f21e">00174</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a5bcddfb319a59f74ddb86f819ac3f21e">evIntentLogin</a>(){<a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">m_pContext</a>-&gt;evIntentLogin();}
<a name="l00175"></a><a class="code" href="class_login_mvc.html#a7261b77a220b0e5f63b78aeffb825a57">00175</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a7261b77a220b0e5f63b78aeffb825a57">evCancelLogin</a>(){<a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">m_pContext</a>-&gt;evCancelLogin();}
<a name="l00176"></a>00176     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#ab936dfb09fbd609249cb46b91af15459">evIntentContinue</a>();
<a name="l00177"></a><a class="code" href="class_login_mvc.html#a54f9987f4e8f29076c360c936ff8e131">00177</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a54f9987f4e8f29076c360c936ff8e131">evIntentLogout</a>(){<a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">m_pContext</a>-&gt;evIntentLogout();}
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="comment">// Events from the Model to the Fsm</span>
<a name="l00180"></a><a class="code" href="class_login_mvc.html#a55e8d0a25944d5f67f7b3e6266914541">00180</a>     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a55e8d0a25944d5f67f7b3e6266914541">evLoginComplete</a>(<span class="keywordtype">bool</span> success){<a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">m_pContext</a>-&gt;evLoginComplete(success);}
<a name="l00181"></a>00181 
<a name="l00182"></a>00182     <span class="comment">// Called when the context ends</span>
<a name="l00183"></a>00183     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#ad63b0fff1d9c266c20804e43f9277565">contextEnd</a>();
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="keyword">private</span>:
<a name="l00186"></a>00186 
<a name="l00187"></a>00187     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a87d2c349c352f9f71a4afc2dc861bfc6">initSignalSlot</a>();
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="keywordtype">void</span> <a class="code" href="class_login_mvc.html#a26ad074cf6f826b49efe0d57618459f3">logInit</a>();
<a name="l00190"></a>00190 
<a name="l00191"></a>00191     <span class="comment">// Generated class</span>
<a name="l00192"></a><a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">00192</a>     LoginMvcContext *<a class="code" href="class_login_mvc.html#a159cd30719f8509d3243527a8f3f1e24">m_pContext</a>;
<a name="l00193"></a>00193 
<a name="l00194"></a><a class="code" href="class_login_mvc.html#a95a90c5c202ead622c77035868507d0f">00194</a>     <a class="code" href="class_abstract_model.html">AbstractModel</a>* <a class="code" href="class_login_mvc.html#a95a90c5c202ead622c77035868507d0f">m_pModel</a>;
<a name="l00195"></a><a class="code" href="class_login_mvc.html#a822a8c9fc27e024f9a4f506a997c0b9a">00195</a>     <a class="code" href="class_my_view.html">MyView</a>* <a class="code" href="class_login_mvc.html#a822a8c9fc27e024f9a4f506a997c0b9a">m_pView</a>;
<a name="l00196"></a>00196 
<a name="l00197"></a><a class="code" href="class_login_mvc.html#a7a1ca2ff001c8500a230f69cddf12ae6">00197</a>     <span class="keywordtype">int</span> <a class="code" href="class_login_mvc.html#a7a1ca2ff001c8500a230f69cddf12ae6">m_loginTimeout</a>;
<a name="l00198"></a><a class="code" href="class_login_mvc.html#a7c3075d74734b83061c2fe7aa9a30d9f">00198</a>     <span class="keywordtype">bool</span> <a class="code" href="class_login_mvc.html#a7c3075d74734b83061c2fe7aa9a30d9f">firstTime</a>;
<a name="l00199"></a><a class="code" href="class_login_mvc.html#ab3b8d0e25bea9f29874af6d0571951d7">00199</a>     QString <a class="code" href="class_login_mvc.html#ab3b8d0e25bea9f29874af6d0571951d7">m_username</a>;
<a name="l00200"></a><a class="code" href="class_login_mvc.html#ae51d46d55a387571ac137c6187a36831">00200</a>     QString <a class="code" href="class_login_mvc.html#ae51d46d55a387571ac137c6187a36831">m_password</a>;
<a name="l00201"></a>00201 };
<a name="l00202"></a>00202 
<a name="l00203"></a>00203 <span class="preprocessor">#endif // LOGINMVC_H</span>
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
